1. Field of the Invention
The present invention relates generally to compression technologies, and more specifically to a method and apparatus for decoding variable length codes (e.g., Huffman Encoding) while using optimal resources.
2. Related Art
Symbols are often encoded using variable length codes. Huffman encoding provides an example approach to such encoding. Variable length encoding has been used in several environments, typically due to the loss-less nature and the level of compression achieved.
In a typical scenario, an encoder encodes each input symbol to a corresponding bit string (code word) using a pre-specified table, with the length of code-word potentially being different for different input symbols. In general, short length code words are chosen for frequently occurring input symbols. A decoder then receives a bit stream containing such variable length codes and constructs the symbols by using the inverse encoding tables (or corresponding information).
Several resources are generally required to decode the input symbols (or a stream of bits forming a sequence of symbols). For example, memory is required to store the tables used for decoding, and computational resources are required to perform various look-up and other operations to support the decoding task. Approaches may require more of one type of resource, while attempting to reduce requirements of other types of resources.
It is generally desirable to optimize the resource requirements while decoding variable length code words.
In the drawings, like reference numbers generally indicate identical, functionally similar, and/or structurally similar elements. The drawing in which an element first appears is indicated by the leftmost digit(s) in the corresponding reference number.